home *** CD-ROM | disk | FTP | other *** search
- // memory.c example 1
- // cl /AL /Lp memory.c
- // bind286 memory
- // memory
-
- #include <stdlib.h>
- #include <stdio.h>
-
- main()
- {
- int i = 0;
- printf("Allocating memory...\n");
- while(1)
- if (malloc((unsigned)65512))
- printf("Allocated 64K: %d blocks\n",++i);
- else
- break;
- printf("Ran out of available memory\n\n");
- printf("Allocated %dK total.\n",i*64);
- }
-